'******************************************************

LBBROWSE3.DLL is copyright Alyce Watson, 2006.

'******************************************************

LBBROWSE3.DLL is freeware. You may use it in any application, including commercial products. A credit to the author and a link to the website must be included in your program's documentation or readme file, and in any source code released to the public.

Alyce Watson
http://alycesrestaurant.com/

'******************************************************

Use this DLL at your own risk. The author bears no responsibility for errors that may occur as the result of its use. It is not warranted to be suitable for any application or Operating System. Use of this DLL indicates that you hold the author harmless for any problems that occur from its use.

'******************************************************

You may not reverse-engineer this DLL. You may not claim it as your own work.

'******************************************************

LBBROWSE3.DLL requires MSIE v4.0 or better.

You may have only one browser control in your LB program. If your program crashes and the DLL is not closed properly, or if you have a problem running the program a second time, close Liberty BASIC before attempting to run it again. It may be necessary to reboot if you have a program crash. Consider using "on error" in your code and calling DestroyBrowser and closing the DLL in the event of an error.

The functions in the "extras" menu of the demo may not all work on earlier versions of Windows, but they will not cause an error if they don't work.

This DLL can also be used to view jpg, gif, animated gif, or any other type of file or URL that a browser can display.

Be sure to open the DLL like this:
open "LBBROWSE3.DLL" for dll as #b

Call CreateBrowser to create a browser control.

When the program ends, call DestroyBrowser, then close the DLL.
'******************************************************
' NEW IN LBBROWSE3.DLL
'******************************************************
    calldll #b, "CanGoBack",_ 'determine if can navigate back
    goback as long            'returns 1 if can, 0 if can't

    calldll #b, "CanGoForward",_ 'determine if can navigate forward
    goforward as long         'returns 1 if can, 0 if can't

'******************************************************
' NEW IN LBBROWSE2.DLL
'******************************************************
    geturl$=space$(1000)
calldll #b, "GetURL",_ 'get current URL
    geturl$ as ptr,_ 'string buffer will hold URL 
    re as void       'no return

    'limit to history is string 32000 characters long
    'history is list of all URLs accessed in this session
    'URLs are separated by spaces
    'function returns the length of the history string
    gethist$ = space$(32000)
calldll #b, "GetHistory",_
    gethist$ as ptr,_   'string buffer will hold history list
    re as ulong         'length of returned string

    'clears the internal DLL string holding the list of visited URLs
calldll #b, "ClearHistory",_
    re as void          'no return


'******************************************************
' FUNCTIONS IN LBBROWSE.DLL
'******************************************************
calldll #b, "CreateBrowser",_   'call this first
    hWnd as ulong,_ 'handle of program window
    x as long,_     'x location on window
    y as long,_     'y location on window
    w as long,_     'width of browser control
    h as long,_     'height of browser control
    url$ as ptr,_   'initial URL
    border as long,_'1=has border,0=no border
    result as long  '0=success

calldll #b, "DestroyBrowser",_  'destroy browser when window closes
    re as void      'no return

calldll #b, "DLLVersion",_  'return version of DLL
    version as long         'version of this DLL

calldll #b, "Navigate",_    'load URL, or file
    url$ as ptr,_   'url or filename
    ret as void     'no return
    
calldll #b, "BrowserString",_   'load html page from memory string
    html$ as ptr,_  'string containing html code
    ret as void     'no return
    
calldll #b, "BrowserPrint",_  'print hard copy of page
    re as void      'no return

calldll #b, "Home",_    'load user's home page
    ret as void     'no return

calldll #b, "Cancel",_    'stop page from loading
    ret as void     'no return

calldll #b, "Search",_    'load user's search page
    ret as void     'no return

calldll #b, "Back",_    'reload previous page in history
    ret as void     'no return

calldll #b, "Forward",_    'reload next page in history
    ret as void     'no return

calldll #b, "Refresh",_    'refresh current page
    ret as void     'no return
    
calldll #b, "EnableBrowser",_   'enable/disable the browser control
    state as long,_ '1=enabled, 0=disabled
    ret as void     'no return

calldll #b, "ShowBrowser",_   'show/hide the browser control
    state as long,_ '1=show, 0=hide
    ret as void     'no return

calldll #b, "MoveBrowser",_     'relocate and resize browser control,
    x as long,_     'new x location
    y as long,_     'new y location
    width as long,_ 'new width
    height as long,_'new height
    ret as void     'no return

calldll #b, "ShowStatusbar",_   'statusbar is shown by default
    show as long,_  'show=1,hide=0
    ret as void     'no return

    status$=space$(1000)
calldll #b, "GetStatusText",_   'get status of browser while loading page
    status$ as ptr,_    'string buffer will hold status text
    re as void          'no return

    title$=space$(1000)
calldll #b, "GetTitle",_   'get page title
    title$ as ptr,_     'string buffer will hold page title
    re as void          'no return

calldll #b, "PrintPreview",_    'open Print Preview window
    re as void          'no return

calldll #b, "PageSetup",_ 'open Page Setup dialog
    re as void          'no return

calldll #b, "Properties",_ 'show page properties
    re as void          'no return

calldll #b, "MakeDesktopShortcut",_ 'create shortcut on desktop for this page
    re as void          'no return

calldll #b, "SendEMail",_ 'open default email client with blank email
    re as void          'no return

calldll #b, "AddToFavorites",_ 'call up Add-To-Favorites dialog
    re as void          'no return
    
calldll #b, "ViewSource",_ 'view source in user's default program 
    re as void          'no return

calldll #b, "InternetOptions",_ 'open Internet Options dialog
    re as void          'no return

calldll #b, "DoFontSize",_ 'set font size, 1-5
    size as long,_ '1-5  1=small, 5=large
    re as void          'no return


'******************************************************
'******************************************************
		IMPORTANT NOTE 
'******************************************************
'******************************************************
This DLL is not to be confused with the Browser.DLL that was introduced to Liberty BASIC users in 2002 by Doyle Whisenant. The credits for the DLL used by Doyle are as follows:

     Browser.Dll is based on VC++ code by Jeff Glatt 
     but compiled using Lcc-Win32 by 
     Kevin Diggins 12/20/2002

